using System;
using System.Collections.Generic;
using DataStore.Domain;
using NHibernate;

namespace DataStore.Repositories
{
    public class JournalRepository : IRepository<Journal>
    {
        readonly UnitOfWork _unitOfWork;

        public JournalRepository(UnitOfWork unitOfWork)
        {
            _unitOfWork = unitOfWork;
        }

        public Journal Get(object id)
        {
            throw new NotImplementedException();
        }

        public void Delete(Journal entity)
        {
            ISession session = _unitOfWork.Session;
            session.Delete(entity);
        }

        public void DeleteAll()
        {
            throw new NotImplementedException();
        }

        public void Save(Journal entity)
        {
            ISession session = _unitOfWork.Session;
            session.Save(entity);
        }

        public Journal SaveOrUpdate(Journal entity)
        {
            ISession session = _unitOfWork.Session;
            session.SaveOrUpdate(entity);
            return entity;
        }

        public void Update(Journal journal)
        {
            ISession session = _unitOfWork.Session;
            session.Update(journal);
                
        }

        public IEnumerable<Journal> All
        {
            get { throw new NotImplementedException(); }
        }

        public bool Exists(Journal entity)
        {
            throw new NotImplementedException();
        }

        public bool IsEmpty
        {
            get { throw new NotImplementedException(); }
        }

        public int Count(Journal entity)
        {
            throw new NotImplementedException();
        }

        public int CountAll()
        {
            throw new NotImplementedException();
        }
    }
}